<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
<!--<script src="https://cdn.staticfile.org/jquery/3.4.0/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>-->

<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.js"></script>
<script src="https://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>

<script>
$(document).ready(function(){
  $.cookie('name', '111');  // 创建 cookie
  var name = $.cookie('name');     // 读取 cookie
  $("#test").text(name);
  $.cookie('name2', '222', { expires: 7, path: '/' });
  var name2 = $.cookie('name2');
  $("#test2").text(name2);
});
</script>
</head>
<body>
<p>test</p>
<p id="test"></p>
<p id="test2"></p>
</body>
</html>